#include <stdio.h>
#include <string.h>

double x, y, z;
double x1, y1, z1, x2, y2, z2;
int n;

bool in()
{
    while (scanf("%lf%lf%lf%d", &x, &y, &z, &n)!=4) return false;
    return true;
}    

void deal()
{
    int i;
    double dis;
    dis = z/n;
    x1 = y1 = z1 = 0;
    x2 = x;
    y2 = y;
    z2 = dis;
    for (i=0; i<n; ++i)
    {
        printf("%.8lf %.8lf %.8lf %.8lf %.8lf %.8lf\n", x1, y1, z1, x2, y2, z2);
        z1 += dis;
        z2 += dis;
    }    
    
    
}    

int main()
{
    while (in())
    {
        deal();    
    }        
    return 0;    
}    
